package net.sf.midollo.net.protocol.echo;

import java.io.IOException;

import net.sf.midollo.io.IOStream;
import net.sf.midollo.net.protocol.Protocol;
import net.sf.midollo.net.protocol.ProtocolFactory;

public class EchoFactory implements ProtocolFactory {

  protected int bufSize;

  public EchoFactory() {
    this(Echo.DEFAULT_BUFFER_SIZE);
  }

  public EchoFactory(int bufSize) {
    this.bufSize = bufSize;
  }

  public Protocol connect(IOStream ioRequest) throws IOException {
    return new Echo(ioRequest, this.bufSize);
  }
}
